package com.xiyu.service.controller.admin.statistics;
import com.xiyu.service.framework.web.web.core.pojo.CommonResult;
import com.xiyu.service.vo.statistics.statisticsMail.StatisticsMailReceiveSendQueryOutput;
import com.xiyu.service.vo.statistics.statisticsMail.StatisticsMailReceiveSendQueryInput;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import io.swagger.v3.oas.annotations.tags.Tag;

import com.xiyu.service.service.statistics.StatisticsMailService;

import java.util.List;

import static com.xiyu.service.framework.web.web.core.pojo.CommonResult.success;

@Tag(name = "邮件统计")
@RestController
@RequestMapping("/statistics/statistics-mail")
@Validated
public class StatisticsMailController {

    @Resource
    private StatisticsMailService statisticsMailService;

    @PostMapping("/receive-send-query")
    @Operation(summary = "邮件收发情况")
    @PreAuthorize("@ss.hasPermission('statistics:mail:receiveSend')")
    public CommonResult<List<StatisticsMailReceiveSendQueryOutput>> receiveSendQuery(@Valid @RequestBody StatisticsMailReceiveSendQueryInput inputVO) {
        return success(statisticsMailService.receiveSendQuery(inputVO));
    }

}
